<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MolTK C++ API: C:/Users/cmbruns/svn/moltk/c++/include/moltk/Structure.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="moltk55.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MolTK C++ API
   &#160;<span id="projectnumber">0.3.0</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">C:/Users/cmbruns/svn/moltk/c++/include/moltk/Structure.h</div>  </div>
</div>
<div class="contents">
<a href="Structure_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">    MolTK is a Python and C++ toolkit for protein sequence/structure alignment and visualization</span>
<a name="l00003"></a>00003 <span class="comment">    Copyright (C) 2011  Christopher M. Bruns</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment">    This program is free software; you can redistribute it and/or modify</span>
<a name="l00006"></a>00006 <span class="comment">    it under the terms of the GNU General Public License as published by</span>
<a name="l00007"></a>00007 <span class="comment">    the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment">    (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">    This program is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00013"></a>00013 <span class="comment">    GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"></span>
<a name="l00015"></a>00015 <span class="comment">    You should have received a copy of the GNU General Public License along</span>
<a name="l00016"></a>00016 <span class="comment">    with this program; if not, write to the Free Software Foundation, Inc.,</span>
<a name="l00017"></a>00017 <span class="comment">    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.</span>
<a name="l00018"></a>00018 <span class="comment">    </span>
<a name="l00019"></a>00019 <span class="comment">    For questions contact: cmbruns@rotatingpenguin.com</span>
<a name="l00020"></a>00020 <span class="comment">*/</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#ifndef MOLTK_CHEM_PDB_STRUCTURE_H</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define MOLTK_CHEM_PDB_STRUCTURE_H</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &quot;<a class="code" href="Biosequence_8h.html">moltk/Biosequence.h</a>&quot;</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="keyword">namespace </span>moltk {
<a name="l00031"></a>00031     
<a name="l00032"></a><a class="code" href="classmoltk_1_1Structure.html">00032</a> <span class="keyword">class </span><a class="code" href="classmoltk_1_1Structure.html">Structure</a> : <span class="keyword">public</span> <a class="code" href="classmoltk_1_1BaseBiosequence.html">BaseBiosequence</a>
<a name="l00033"></a>00033 {
<a name="l00034"></a>00034 <span class="keyword">public</span>:
<a name="l00038"></a><a class="code" href="classmoltk_1_1Structure_1_1Atom.html">00038</a>     <span class="keyword">class </span><a class="code" href="classmoltk_1_1Structure_1_1Atom.html" title="Structure::Atom represents a chemical atom in a molecular structure.">Atom</a>
<a name="l00039"></a>00039     {
<a name="l00040"></a>00040     <span class="keyword">public</span>:
<a name="l00041"></a><a class="code" href="classmoltk_1_1Structure_1_1Atom.html#a1f5b25dc4c830e3b490de57e2ddab887">00041</a>         <span class="keyword">enum</span> <a class="code" href="classmoltk_1_1Structure_1_1Atom.html#a1f5b25dc4c830e3b490de57e2ddab887">RecordType</a> {
<a name="l00042"></a><a class="code" href="classmoltk_1_1Structure_1_1Atom.html#a1f5b25dc4c830e3b490de57e2ddab887a7683d7d09098b5ca454b812b8c73fe2d">00042</a>             <a class="code" href="classmoltk_1_1Structure_1_1Atom.html#a1f5b25dc4c830e3b490de57e2ddab887a7683d7d09098b5ca454b812b8c73fe2d">ATOM_RECORD_TYPE</a>, <span class="comment">//&lt; Standard protein, DNA, or RNA atoms</span>
<a name="l00043"></a><a class="code" href="classmoltk_1_1Structure_1_1Atom.html#a1f5b25dc4c830e3b490de57e2ddab887ab9c10d2842a756acb24a4bb85af3bdc0">00043</a>             <a class="code" href="classmoltk_1_1Structure_1_1Atom.html#a1f5b25dc4c830e3b490de57e2ddab887ab9c10d2842a756acb24a4bb85af3bdc0">HETATM_RECORD_TYPE</a> <span class="comment">//&lt; Other atom types</span>
<a name="l00044"></a>00044         };
<a name="l00045"></a>00045     
<a name="l00047"></a><a class="code" href="classmoltk_1_1Structure_1_1Atom.html#a61de9229745065e4161959573ddbab0f">00047</a>         <span class="keywordtype">int</span> <a class="code" href="classmoltk_1_1Structure_1_1Atom.html#a61de9229745065e4161959573ddbab0f" title="Test function to test python bindings.">foo</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> 5;}
<a name="l00048"></a>00048     
<a name="l00050"></a><a class="code" href="classmoltk_1_1Structure_1_1Atom.html#ae332a281f07f85e306955108a210125d">00050</a>         <a class="code" href="classmoltk_1_1Structure_1_1Atom.html#a1f5b25dc4c830e3b490de57e2ddab887">RecordType</a> <a class="code" href="classmoltk_1_1Structure_1_1Atom.html#ae332a281f07f85e306955108a210125d" title="Whether this is a standard macromolecule atom type (ATOM) or other (HETATM).">getRecordType</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classmoltk_1_1Structure_1_1Atom.html#a83e16b8b355ac9e743a7d23d6dd8baa2">recordType</a>;}
<a name="l00051"></a>00051     
<a name="l00052"></a>00052     <span class="keyword">protected</span>:
<a name="l00053"></a><a class="code" href="classmoltk_1_1Structure_1_1Atom.html#a83e16b8b355ac9e743a7d23d6dd8baa2">00053</a>         <a class="code" href="classmoltk_1_1Structure_1_1Atom.html#a1f5b25dc4c830e3b490de57e2ddab887">RecordType</a> <a class="code" href="classmoltk_1_1Structure_1_1Atom.html#a83e16b8b355ac9e743a7d23d6dd8baa2">recordType</a>;
<a name="l00054"></a>00054     };
<a name="l00055"></a><a class="code" href="classmoltk_1_1Structure.html#a7687cca26873a4ba8904e089ba401f48">00055</a>     <span class="keyword">typedef</span> std::vector&lt;Atom&gt; <a class="code" href="classmoltk_1_1Structure.html#a7687cca26873a4ba8904e089ba401f48">AtomList</a>;
<a name="l00056"></a>00056 
<a name="l00057"></a>00057 
<a name="l00058"></a><a class="code" href="classmoltk_1_1Structure_1_1Residue.html">00058</a>     <span class="keyword">class </span><a class="code" href="classmoltk_1_1Structure_1_1Residue.html">Residue</a> : <span class="keyword">public</span> <a class="code" href="classmoltk_1_1BaseBiosequence_1_1BaseResidue.html">BaseResidue</a>
<a name="l00059"></a>00059     {
<a name="l00060"></a>00060     <span class="keyword">public</span>:
<a name="l00061"></a><a class="code" href="classmoltk_1_1Structure_1_1Residue.html#a09d73ba93cd7e4d9e188ce7ffefd528e">00061</a>         <a class="code" href="classmoltk_1_1Structure_1_1Residue.html#a09d73ba93cd7e4d9e188ce7ffefd528e">Residue</a>() {}
<a name="l00062"></a><a class="code" href="classmoltk_1_1Structure_1_1Residue.html#a962e03156b3b15c2342936c24d90b3d5">00062</a>         <a class="code" href="classmoltk_1_1Structure_1_1Residue.html#a09d73ba93cd7e4d9e188ce7ffefd528e">Residue</a>(<span class="keyword">const</span> <a class="code" href="classmoltk_1_1Structure_1_1Residue.html">Residue</a>&amp; rhs)
<a name="l00063"></a>00063             : <a class="code" href="classmoltk_1_1Structure_1_1Residue.html#a3e9c1d90193505a00ab2426f7d2f194f">oneLetterCode</a>(rhs.<a class="code" href="classmoltk_1_1Structure_1_1Residue.html#a3e9c1d90193505a00ab2426f7d2f194f">oneLetterCode</a>)
<a name="l00064"></a>00064             , <a class="code" href="classmoltk_1_1Structure_1_1Residue.html#aad6385065e18f756f67448fa94c3903e">residueNumber</a>(rhs.<a class="code" href="classmoltk_1_1Structure_1_1Residue.html#aad6385065e18f756f67448fa94c3903e">residueNumber</a>)
<a name="l00065"></a>00065         {}
<a name="l00066"></a><a class="code" href="classmoltk_1_1Structure_1_1Residue.html#a7a6ac381505ee6472d66786a5285fc66">00066</a>         <span class="keyword">virtual</span> <span class="keywordtype">char</span> <a class="code" href="classmoltk_1_1Structure_1_1Residue.html#a7a6ac381505ee6472d66786a5285fc66">getOneLetterCode</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classmoltk_1_1Structure_1_1Residue.html#a3e9c1d90193505a00ab2426f7d2f194f">oneLetterCode</a>;}
<a name="l00067"></a><a class="code" href="classmoltk_1_1Structure_1_1Residue.html#ad9473e365ef923bc5b79b9a2aec16021">00067</a>         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classmoltk_1_1Structure_1_1Residue.html#ad9473e365ef923bc5b79b9a2aec16021">getResidueNumber</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classmoltk_1_1Structure_1_1Residue.html#aad6385065e18f756f67448fa94c3903e">residueNumber</a>;}
<a name="l00068"></a>00068 
<a name="l00069"></a>00069     <span class="keyword">protected</span>:
<a name="l00070"></a><a class="code" href="classmoltk_1_1Structure_1_1Residue.html#a3e9c1d90193505a00ab2426f7d2f194f">00070</a>         <span class="keywordtype">char</span> <a class="code" href="classmoltk_1_1Structure_1_1Residue.html#a3e9c1d90193505a00ab2426f7d2f194f">oneLetterCode</a>;
<a name="l00071"></a><a class="code" href="classmoltk_1_1Structure_1_1Residue.html#aad6385065e18f756f67448fa94c3903e">00071</a>         <span class="keywordtype">int</span> <a class="code" href="classmoltk_1_1Structure_1_1Residue.html#aad6385065e18f756f67448fa94c3903e">residueNumber</a>;
<a name="l00072"></a>00072     };
<a name="l00073"></a>00073 
<a name="l00074"></a>00074 <span class="keyword">public</span>:
<a name="l00075"></a><a class="code" href="classmoltk_1_1Structure.html#aeb55e033ab60c46fd4882b22e8ff9b89">00075</a>     <a class="code" href="classmoltk_1_1Structure.html#aeb55e033ab60c46fd4882b22e8ff9b89">Structure</a>() {}
<a name="l00076"></a>00076     <span class="keyword">explicit</span> <a class="code" href="classmoltk_1_1Structure.html#aeb55e033ab60c46fd4882b22e8ff9b89">Structure</a>(std::istream&amp;);
<a name="l00077"></a>00077     <span class="keyword">explicit</span> <a class="code" href="classmoltk_1_1Structure.html#aeb55e033ab60c46fd4882b22e8ff9b89">Structure</a>(<span class="keyword">const</span> std::string&amp; fileName);
<a name="l00078"></a><a class="code" href="classmoltk_1_1Structure.html#a6420d8e9bb348027d831d2193afe590a">00078</a>     <a class="code" href="classmoltk_1_1Structure.html#aeb55e033ab60c46fd4882b22e8ff9b89">Structure</a>(<span class="keyword">const</span> <a class="code" href="classmoltk_1_1Structure.html">Structure</a>&amp; rhs)
<a name="l00079"></a>00079         : <a class="code" href="classmoltk_1_1Structure.html#a7e6711d142c60f7230d18689032f18f9">atoms</a>(rhs.<a class="code" href="classmoltk_1_1Structure.html#a7e6711d142c60f7230d18689032f18f9">atoms</a>)
<a name="l00080"></a>00080         , <a class="code" href="classmoltk_1_1Structure.html#a23f87a7889a3c306ec3def7164b09277">residues</a>(rhs.<a class="code" href="classmoltk_1_1Structure.html#a23f87a7889a3c306ec3def7164b09277">residues</a>)
<a name="l00081"></a>00081     {}
<a name="l00082"></a>00082     <span class="keywordtype">bool</span> <a class="code" href="classmoltk_1_1Structure.html#a4010facabbb3faf58e006853ed4f0b37">loadStream</a>(std::istream&amp;);
<a name="l00083"></a>00083     <span class="keywordtype">bool</span> <a class="code" href="classmoltk_1_1Structure.html#a737bc399f21d38244840d66886bd9de4">loadFile</a>(<span class="keyword">const</span> std::string&amp; fileName);
<a name="l00084"></a><a class="code" href="classmoltk_1_1Structure.html#a69e8f0f7cfe55b06cae6d2a1c6d9bf63">00084</a>     <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> <a class="code" href="classmoltk_1_1Structure.html#a69e8f0f7cfe55b06cae6d2a1c6d9bf63">getNumberOfResidues</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classmoltk_1_1Structure.html#a23f87a7889a3c306ec3def7164b09277">residues</a>.size();}
<a name="l00085"></a><a class="code" href="classmoltk_1_1Structure.html#a1d9263ce9e7e8bfe06b5399acc01976b">00085</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classmoltk_1_1BaseBiosequence_1_1BaseResidue.html">BaseResidue</a>&amp; <a class="code" href="classmoltk_1_1Structure.html#a1d9263ce9e7e8bfe06b5399acc01976b">getResidue</a>(<span class="keywordtype">size_t</span> index)<span class="keyword"> const </span>{
<a name="l00086"></a>00086         <span class="keywordflow">return</span> <a class="code" href="classmoltk_1_1Structure.html#a23f87a7889a3c306ec3def7164b09277">residues</a>[index];
<a name="l00087"></a>00087     }
<a name="l00088"></a>00088 
<a name="l00089"></a>00089 <span class="keyword">protected</span>:
<a name="l00090"></a><a class="code" href="classmoltk_1_1Structure.html#a7e6711d142c60f7230d18689032f18f9">00090</a>     <a class="code" href="classmoltk_1_1Structure.html#a7687cca26873a4ba8904e089ba401f48">AtomList</a> <a class="code" href="classmoltk_1_1Structure.html#a7e6711d142c60f7230d18689032f18f9">atoms</a>;
<a name="l00091"></a><a class="code" href="classmoltk_1_1Structure.html#a23f87a7889a3c306ec3def7164b09277">00091</a>     std::vector&lt;Residue&gt; <a class="code" href="classmoltk_1_1Structure.html#a23f87a7889a3c306ec3def7164b09277">residues</a>;
<a name="l00092"></a>00092 };
<a name="l00093"></a>00093 
<a name="l00094"></a>00094 } <span class="comment">// namespace moltk</span>
<a name="l00095"></a>00095 
<a name="l00096"></a><a class="code" href="Structure_8h.html#a3210ca100cd32674b3b54581a07e324b">00096</a> <span class="keyword">inline</span> std::istream&amp; <a class="code" href="MatrixScorer_8h.html#af3c3d0e4d1b9e7a565922f7d9c8a0871">operator&gt;&gt;</a>(std::istream&amp; is, <a class="code" href="classmoltk_1_1Structure.html">moltk::Structure</a>&amp; structure)
<a name="l00097"></a>00097 {
<a name="l00098"></a>00098     structure.<a class="code" href="classmoltk_1_1Structure.html#a4010facabbb3faf58e006853ed4f0b37">loadStream</a>(is);
<a name="l00099"></a>00099     <span class="keywordflow">return</span> is;
<a name="l00100"></a>00100 }
<a name="l00101"></a>00101 
<a name="l00102"></a>00102 
<a name="l00103"></a>00103 <span class="preprocessor">#endif // MOLTK_PDB_STRUCTURE_H</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
